package cn.iocoder.yudao.module.product.dal.mysql.stockoutin;


import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.product.dal.dataobject.stockoutin.StockOutInDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.product.controller.admin.stockoutin.vo.*;

/**
 * 库存操作 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface StockOutInMapper extends BaseMapperX<StockOutInDO> {

    default PageResult<StockOutInDO> selectPage(StockOutInPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StockOutInDO>()
                .eqIfPresent(StockOutInDO::getOutOwnerId, reqVO.getOutOwnerId())
                .eqIfPresent(StockOutInDO::getOutOwnerType, reqVO.getOutOwnerType())
                .eqIfPresent(StockOutInDO::getInOwnerId, reqVO.getInOwnerId())
                .eqIfPresent(StockOutInDO::getInOwnerType, reqVO.getInOwnerType())
                .betweenIfPresent(StockOutInDO::getOutTime, reqVO.getOutTime())
                .betweenIfPresent(StockOutInDO::getInTime, reqVO.getInTime())
                .eqIfPresent(StockOutInDO::getType, reqVO.getType())
                .eqIfPresent(StockOutInDO::getOutSkuCount, reqVO.getOutSkuCount())
                .eqIfPresent(StockOutInDO::getInSkuCount, reqVO.getInSkuCount())
                .eqIfPresent(StockOutInDO::getVehicleId, reqVO.getVehicleId())
                .eqIfPresent(StockOutInDO::getDeliveryPersonId, reqVO.getDeliveryPersonId())
                .likeIfPresent(StockOutInDO::getSupercargoName, reqVO.getSupercargoName())
                .eqIfPresent(StockOutInDO::getOutWay, reqVO.getOutWay())
                .eqIfPresent(StockOutInDO::getCylinderCount, reqVO.getCylinderCount())
                .eqIfPresent(StockOutInDO::getCylinderTypeId, reqVO.getCylinderTypeId())
                .likeIfPresent(StockOutInDO::getOutName, reqVO.getOutName())
                .likeIfPresent(StockOutInDO::getInName, reqVO.getInName())
                .betweenIfPresent(StockOutInDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(StockOutInDO::getUpdater, reqVO.getUpdater())
                .orderByDesc(StockOutInDO::getId));
    }

}